package com.hzncc.flowable_diboot.controller.contract;

import com.diboot.core.controller.BaseCrudRestController;
import com.diboot.core.vo.JsonResult;
import com.diboot.core.vo.Pagination;
import com.hzncc.flowable_diboot.entity.contract.Contract;
import com.hzncc.flowable_diboot.service.ContractService;
import com.hzncc.flowable_diboot.vo.contract.ContractListVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/contract")
@RequiredArgsConstructor
public class ContractController extends BaseCrudRestController<Contract> {

    private final ContractService contractService;

    /**
     * 获取列表
     * @param contract 查询参数
     * @param pagination 分页参数
     * @return
     * @throws Exception
     */
    @GetMapping()
    public JsonResult<?> getList(Contract contract, Pagination pagination) throws Exception {
        return super.getViewObjectList(contract, pagination, ContractListVO.class);
    }
}
